Skip to content

fix: #2258 add normalized to_input_list mode for filtered handoff follow-ups - #2667

Merged
seratch merged 1 commit into
mainfrom
fix/to-input-list-normalized-mode
Mar 14, 2026
Merged

fix: #2258 add normalized to_input_list mode for filtered handoff follow-ups#2667
seratch merged 1 commit into
mainfrom
fix/to-input-list-normalized-mode

Conversation

@seratch

@seratch seratch commented Mar 14, 2026

Copy link
Copy Markdown
Member

This pull request resolves #2258 by adding a normalized view for RunResult.to_input_list() that exposes the same continuation input the runner uses after nested handoff history or handoff input filters rewrite model history.

  • Keep mode="preserve_all" as the default so existing callers still get the full converted history and current to_input_list() behavior remains compatible.
  • Add mode="normalized" as an opt-in path that switches to _model_input_items only when the runner recorded a real divergence between model-facing continuation and richer session history.
  • Propagate that normalized replay signal across sync, interruption, and streaming result builders so follow-up runs behave the same regardless of execution path.
  • Cover the real failure modes behind .to_input_list() provides unparsable data if handoff happens in that run w/ nest_handoff_history: true #2258: nested handoffs, custom handoff filters, and cases where the delegated agent adds its own tool calls that must be preserved in follow-up input.

@seratch seratch added this to the 0.12.x milestone Mar 14, 2026
@github-actions github-actions Bot added enhancement New feature or request feature:core labels Mar 14, 2026
@seratch
seratch merged commit e88bcf2 into main Mar 14, 2026
9 checks passed
@seratch
seratch deleted the fix/to-input-list-normalized-mode branch March 14, 2026 01:03
seratch added a commit that referenced this pull request Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature:core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.to_input_list() provides unparsable data if handoff happens in that run w/ nest_handoff_history: true

1 participant